package com.killer.common.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {


    public static Date getNow(){
        return new Date();
    }

    public static String format(Date date, String format) {
        if (date == null) {
            return null;
        }
        return new SimpleDateFormat(format).format(date);
    }

    public static String format(Date date) {
       return format(date, "yyyy-MM-dd");
    }

    public static void main(String[] args) {
        System.out.println(format(getNow(), "yyyy-MM-dd-HH-mm-ss"));
    }
}
